package cn.hh.ymcc.web.controller;

import cn.hh.ymcc.domain.MessageBlacklist;
import cn.hh.ymcc.domain.MessageSms;
import cn.hh.ymcc.result.JSONResult;
import cn.hh.ymcc.service.IVerifyCodeService;
import cn.hh.ymcc.vo.MessageSmsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import org.yaml.snakeyaml.events.Event;

@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {

    @Autowired
    private IVerifyCodeService verifyCodeService;


    /**
     *  添加黑名单
     * @param messageSms : 用户
     * @return
     */
    @PostMapping( "/saveblacklist")
    public JSONResult saveblacklist(@RequestBody MessageSmsVO messageSms){

        return verifyCodeService.saveblacklist(messageSms);

    }





    /**
     *  发送短信验证码
     * @param mobile : 手机号
     * @return
     */
    @GetMapping("/sendSmsCode/{mobile}")
    public JSONResult smdCode(@PathVariable("mobile") String mobile){
        verifyCodeService.smsCode(mobile);
        return JSONResult.success();

    }




}
